package com.zzyl.web.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.pojo.NursingProject;
import com.zzyl.nursing.service.MemberServicesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.zzyl.common.utils.PageUtils.startPage;

@Api(tags = "老人家属服务管理")
@RestController
@RequestMapping("/member")
public class MemberServicesController extends BaseController {
    @Autowired
    private MemberServicesService memberServicesService;
    /**
     * 查询护理项目列表
     */
    @GetMapping("/orders/project/page")
    @ApiOperation("小程序分页查询服务项目")
    public TableDataInfo<List<NursingProject>> list(@ApiParam("护理项目查询条件") NursingProject nursingProject)
    {
        startPage();
        List<NursingProject> list = memberServicesService.selectNursingProjectList(nursingProject);
        return getDataTable(list);
    }

    /**
     * 查询单个项目详细信息
     */
    @GetMapping("/orders/project/{id}")
    @ApiOperation("小程序查询服务项目详细信息")
    public R<NursingProject> getOneInfo(@ApiParam("护理项目查询条件") @PathVariable Integer id)
    {
        return R.ok(memberServicesService.getOneInfoById(id));
    }

    /**
     * 查询预约记录
     */


}
